import { Tools } from 'weaver-mobile';
import { catchApiError, PARAMS } from '../util/index';

/**************************协作申请 *******************************/
//协作 - 申请加入 - 列表
export const getCoworkApplyPageList = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/apply/getCoworkApplyPageList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}


//协作 - 申请加入 - 加入
export const coworkApplayInfo = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/apply/coworkApplayInfo',
		params: {...PARAMS, ...params},
	};
	return Tools.callApi(options).then(catchApiError);
}

//协作 - 申请加入 - 高级搜索
export const getCoworkApplyShareCondition = params => {
	let options = {
		method: 'get',
		url: '/api/cowork/apply/getCoworkApplyShareCondition',
		params: {...PARAMS, ...params},
	};
	return Tools.callApi(options).then(catchApiError);
}

/**************************申请审批 *******************************/

//协作 - 申请审批 - 批准/拒绝
export const coworkApplayApproveInfo = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/apply/coworkApplayApproveInfo',
		params: {...PARAMS, ...params},
	};
	return Tools.callApi(options).then(catchApiError);
}

//协作 - 申请审批 - 批准/拒绝
export const getCoworkApplyPageTopCounts = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/apply/getCoworkApplyPageTopCounts',
		params: {...PARAMS, ...params},
	};
	return Tools.callApi(options).then(catchApiError);
}